package com.getpebble.android.framework.protocol.outbound;

import com.getpebble.android.framework.protocol.EndpointId;

public class PblOutboundLogDumpMessage extends PblOutboundMessage {
    private final byte[] mCookie;
    private final byte mGenerationId;

    public PblOutboundLogDumpMessage(int generation, byte[] cookie) throws IllegalArgumentException {
        super(EndpointId.LOG_DUMP);
        this.mGenerationId = (byte) (generation & 255);
        this.mCookie = cookie;
    }

    public synchronized byte[] getBytes() {
        if (!areBytesCached()) {
            addBytes(Byte.valueOf((byte) 16));
            addBytes(Byte.valueOf(this.mGenerationId));
            addBytes(this.mCookie);
        }
        return super.getBytes();
    }
}
